package com.lee.demo.ui.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;

import com.lee.demo.R;

import cn.lee.cplibrary.widget.anim.FreeImageView;
import cn.lee.cplibrary.widget.anim.FreeTextView;

/**
 * @author xiao
 */
public class FreeViewActivity extends AppCompatActivity {
    FreeImageView iv;
    FreeTextView tv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_free_view);
        initView();
    }

    private void initView() {
        iv = findViewById(R.id.iv);
        tv = findViewById(R.id.tv);
        iv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (!iv.isDrag()) {
                    Toast.makeText(FreeViewActivity.this, "点击了FreeImageView", Toast.LENGTH_SHORT).show();
                }

            }
        });

        tv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (!iv.isDrag()) {
                    Toast.makeText(FreeViewActivity.this, "点击了FreeTextView", Toast.LENGTH_SHORT).show();
                }

            }
        });
    }
}
